package com.sneakxy.mybase4j.platform.repository;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.sneakxy.mybase4j.base.repository.BaseRepository;
import com.sneakxy.mybase4j.platform.beans.AccountRole;
import com.sneakxy.mybase4j.platform.beans.AccountRoleId;

/**
 * 
 * @author 潜行的青衣
 * @see
 */
@Repository
public interface AccountRoleRepository extends BaseRepository<AccountRole, AccountRoleId> {

	@Select("select role_id from t_mb4j_account_role where account_id=#{account_id}")
	public List<String> findRoles(@Param("account_id") String account_id);
	
	@Delete("delete from t_mb4j_account_role where role_id=#{role_id}")
	public int deleteByRoleId(@Param("role_id") String role_id);
	
	@Delete("delete from t_mb4j_account_role where account_id=#{account_id}")
	public int deleteByAccountId(@Param("account_id") String account_id);
	
}
